package space.xxhui.binderdemo.Module;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by hui on 2016/10/7.
 */

public class Book implements Parcelable {

    private int bookId;
    private String bookName;

    public Book(Parcel source) {
        bookId = source.readInt();
        bookName = source.readString();
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(bookId);
        dest.writeString(bookName);
    }

    public static final Creator<Book> CREATOR = new Creator<Book>() {
        @Override
        public Book createFromParcel(Parcel source) {
            return new Book(source);
        }

        @Override
        public Book[] newArray(int size) {
            return new Book[0];
        }
    } ;
}
